import { mapActions, mapState }  from 'vuex';
export default {
  name: 'salary',
  data() {
    return {
        params: {
          // 选中的聘用形式
          approvalsTypeChecks: [],
          // 选中的员工状态
          approvalsStateChecks: [],
          // 选中的部门
          departmentChecks: []
        },
        page: 1,
        dialogVisible: false,
        form: {
          name: '',
          region: '',
          date1: '',
          date2: '',
          delivery: false,
          type: [],
          resource: '',
          desc: ''
        }
      }
    },
  watch: {
    params: {
      deep: true,
      handler(newValue) {
        console.log(newValue)
      }
    }
  },
  methods: {
    ...mapActions('department', ['updateDepartmentList']),
    ...mapActions('salary', ['updateSalaryList']),
    handleClose(done) {
        this.$confirm('确认关闭？')
          .then(_ => {
            done();
          })
          .catch(_ => {});
      }
  },
  computed: {
    ...mapState('department', ['departmentList']),
    ...mapState('salary', ['salaryList'])
  },
  created() {
    this.updateDepartmentList();
    this.updateSalaryList({
      ...this.params,
      page: this.page
    })
  }
}
